<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>我的信息 - 派后台管理系统</title>
    {include file="public/header" /}
    <style>
        .mytb{
            float: right;
            font-size: 14px;
        }
        .mytb::after {
            font-family: 'Material Design Icons';
            color: rgb(170, 170, 170);
            display: block;
            float: right;
            content: "\f35d";
            padding-left: 5px;
        }
        .collapsed > .mytb:after {
            content: '\f142';
        }
        .panel-title{
            color: #666;
        }
        .panel-title .active{
            color: #000;
        }
    </style>
</head>
<body>
<div class="container-fluid p-t-15">
    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <div class="card-header"><h4>搜索</h4></div>
                <div class="card-body">
                    <form class="form-inline searchForm">
                        <div class="form-group">
                            <label for="title">关键词</label>
                            <div class="input-group">
                                <div class="input-group">
                                    <input type="text" class="form-control" id="title" value="{$where.title}" autocomplete="off" name="title" placeholder="请输入标题或者内容">
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="start_time">时间</label>
                            <div class="input-group">
                                <input class="form-control js-datetimepicker" type="text" id="start_time" autocomplete="off" name="start_time" value="{$where.start_time}" data-side-by-side="true" data-locale="zh-cn" data-format="YYYY-MM-DD" placeholder="开始时间">
                                <span class="input-group-addon">~</span>
                                <input class="form-control js-datetimepicker" type="text" name="end_time" autocomplete="off" value="{$where.end_time}" data-side-by-side="true" data-locale="zh-cn" data-format="YYYY-MM-DD" placeholder="结束时间">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="is_read">是否已读</label>
                            <select name="is_read" id="is_read" class="form-control">
                                <option value="" {if $where.is_read === ''} selected {/if}>所有</option>
                                <option value="1" {if $where.is_read === '1'} selected {/if}>已读</option>
                                <option value="0" {if $where.is_read === '0'} selected {/if}>未读</option>
                            </select>
                        </div>
                        <button type="submit" class="btn btn-success" style="margin: -10px 0 0 10px;" id="search">搜索</button>
                    </form>
                </div>
            </div>
        </div>
        <div class="col-lg-12">
            <div class="card">
                <div class="card-header"><h4>我的信息</h4></div>
                <div class="card-body">
                    <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="false">
                        {volist name="list" id="vo"}
                        <div class="panel panel-default">
                            <div class="panel-heading" role="tab" id="heading{$vo.id}">
                                <h4 class="panel-title">
                                    <a role="button" class="collapsed {if $vo.is_read == 0}active{/if}" data-toggle="collapse" data-parent="#accordion" href="#collapse{$vo.id}" aria-expanded="false" aria-controls="collapse{$vo.id}" onclick="isRead('{$vo.id}')">
                                        {$vo.title} <span class="mytb">{$vo.add_time|date="Y-m-d H:i:s"}</span>
                                    </a>
                                </h4>
                            </div>
                            <div id="collapse{$vo.id}" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading{$vo.id}">
                                <div class="panel-body">
                                    {$vo.content}
                                </div>
                            </div>
                        </div>
                        {/volist}
                    </div>
                    {$list|raw}
                </div>
            </div>
        </div>
    </div>
</div>
</body>
{include file="public/footer"/}
<script>
    function isRead(id) {
        $.post(url="/admin/admin.admin_notify/field?id="+id,{field:'is_read',value:1}); // 点击已读
    }
</script>
</html>